<%-- 
    Document   : visitForm
    Created on : 17.11.2013, 19:35:24
    Author     : palo
--%>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld"%>
<s:useActionBean beanclass="cz.muni.fi.pa165.mushroom.website.web.ForestActionBean" var="forestActionBean"/>
<s:useActionBean beanclass="cz.muni.fi.pa165.mushroom.website.web.MushroomActionBean" var="mushroomActionBean"/>
<s:useActionBean beanclass="cz.muni.fi.pa165.mushroom.website.web.GathererActionBean" var="gathererActionBean"/>
<s:errors/>
<s:messages/>
<table>    

    <tr>
        <th><s:label for="b1" name="visitDto.forestDto"/></th>
        <td>
            <s:select id="b1" name="visitDto.forestDto">                
                <s:option value="">&lt; <f:message key="form.choose"/> &gt;</s:option>
                <c:forEach items="${forestActionBean.forest}" var="forestDto">
                    <s:option value="${forestDto.id}">${forestDto.name}</s:option>
                </c:forEach>                
            </s:select>
        </td>
    </tr>    
    
    <tr>
        <th><s:label for="b2" name="visitDto.info"/></th>
        <td><s:text id="b2" name="visitDto.info"/></td>
    </tr>   
    <tr>
        <th><s:label for="b3" name="visitDto.mushrooms"/></th>
    <table class="basic">
        <tr>                
            <th></th>
            <th><f:message key="showMushrooms.name"/> </th>
            <th><f:message key="showMushrooms.growsFrom"/></th>
            <th><f:message key="showMushrooms.growsUntil"/> </th>
            <th><f:message key="showMushrooms.type"/></th>
        </tr>
        <c:forEach items="${mushroomActionBean.mushroomsVisit}" var="mushroomDto">
            <tr>
                <td> <s:checkbox id="b4" name="visitDto.mushrooms" value="${mushroomDto.id}" /></td>
                <td><c:out value="${mushroomDto.name}"/></td>
                <td><c:out value="${mushroomDto.growsFrom}"/></td>
                <td><c:out value="${mushroomDto.growsUntil}"/></td>
                <td><f:message key="${mushroomDto.type}"/></td>
            </tr>
        </c:forEach> 
        </tr>  

    </table>
</table>